package com.ht.aems.fesmodel;

import java.io.Serializable;
import java.net.DatagramPacket;

/**
 * Interface for ProtocolHandler
 * <p> defines methods for dealing protocol <br>
 * @author Dong Shufeng
 * @Date: 2006-3-4
 * @version 1.0
 */
public interface ProtocolHandler extends Serializable {

    public String getProtocolName() ;

    public void setCommUnitId(int id);

    public int getCommUnitId();

    /**
     * handle data.
     * @param data transmit data
     * @return if the data is need by the handler
     */
    public void handle(byte[] data);

    /**
     * handle data.
     * @param packet transmit data
     * @return if the data is need by the handler
     */
    public void handle(DatagramPacket packet);

}
